package com.ss.android.wenda.answer.detail2;

import android.view.ViewTreeObserver;

final class w implements ViewTreeObserver.OnGlobalLayoutListener {
    private final NewAnswerDetailFragment a;

    w(NewAnswerDetailFragment arg1) {
        this.a = arg1;

    }

    public final void onGlobalLayout() {
        int v2 = 2;
        if(NewAnswerDetailFragment.a(this.a) != null && NewAnswerDetailFragment.a(this.a).mListView != null) {
            if(NewAnswerDetailFragment.p(this.a) == null) {
                NewAnswerDetailFragment.a(this.a, new int[v2]);
            }

            int[] v0 = new int[v2];
            NewAnswerDetailFragment.a(this.a).mDetailScrollView.getLocationInWindow(v0);
            NewAnswerDetailFragment.p(this.a)[0] = v0[1];
            NewAnswerDetailFragment.p(this.a)[1] = v0[1] + NewAnswerDetailFragment.a(this.a).mDetailScrollView.getHeight();
            if(NewAnswerDetailFragment.p(this.a)[0] >= NewAnswerDetailFragment.p(this.a)[1]) {
                return;
            }

            NewAnswerDetailFragment.a(this.a).mListView.getViewTreeObserver().removeGlobalOnLayoutListener(((ViewTreeObserver.OnGlobalLayoutListener)this));
        }
    }
}

